home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
program
/
eflibpt4.zip
/
DEMO
/
DEVICES
/
MOUSE1.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1996-08-16
|
2KB
|
36 lines
{ Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
Demonstration; mouse handling #1
EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED. }
uses EFLIBDEF, EFLIBSCR, EFLIBMSE, EFLIBKBD, EFLIBTXT, CRT;
begin
Screen.HideCursor;
with Mouse, Profile.Video do begin
{ Initialize mouse (not needed other than if text mode changed) }
Reset;
ShowCursor;
{ Set mouse cursor area to demonstrate restricted mouse area }
CursorBox (1, 1, Trunc(Width/1.2), Height);
{ Hide mouse if it enters the following area }
ConditionalOff ((Width-12) div 2, Height div 2,
(Width-12) div 2 + 12, Height div 2 + 3);
repeat
{ NOTE! Use CRT's GotoXY - not Mouse.GotoXY }
CRT.GotoXY ((Width-12) div 2, Height div 2);
WriteLn (WhereX:2, WhereY : 10);
CRT.GotoXY ((Width-12) div 2, Height div 2 + 1);
WriteLn (LastPressedX (MSE_LeftButton) : 2, LastPressedY (MSE_LeftButton) : 10);
CRT.GotoXY ((Width-12) div 2, Height div 2 + 2);
WriteLn (LastReleasedX (MSE_LeftButton) : 2, LastReleasedY (MSE_LeftButton) : 10);
CRT.GotoXY ((Width-12) div 2, Height div 2 + 3);
WriteLn (StringBoolean(LeftButtonPressed) : 5, StringBoolean(RightButtonPressed) : 7);
ShowCursor; { Show mouse cursor if it has been hidden }
until (LeftButtonPressed and RightButtonPressed) or Keyboard.KeyPressed;
end;
end.